<template>
	<view class="container">
		<view class="goods-details" v-if="content">
			<rich-text :nodes="content" :data-nodes="content"></rich-text>
		</view>
	</view>
</template>

<script>
    import htmlParser from '@/common/js/html-parser';
	export default {
		data() {
			return {
				isIphoneX: false, //判断手机是否是iphoneX以上
				id: '',
				content: ''
			}
		},
		onLoad(data) {
			this.isIphoneX = this.$util.uniappIsIPhoneX()
			this.getDetail();
		},
		methods: {
			getDetail() {
				// 获取缓存里面的content
				if (uni.getStorageSync('bannerDetail')) {
					uni.setNavigationBarTitle({
						title: uni.getStorageSync('bannerDetail').title
					});
					let content = uni.getStorageSync('bannerDetail').content;
					// 商品详情
					if (content) this.content = htmlParser(content);
				}
			},
		}
	}
</script>

<style lang="scss" scoped>
.container {
	padding-bottom: 0;
}
</style>
